package com.test.book.dao;


import com.test.book.model.BookInfo;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class BookDao {
    private List<BookInfo> bookList;

    public List<BookInfo> mockBooks(){
         List<BookInfo> bookList = new ArrayList<>();
        for (int i = 0; i < 15; i++) {
            BookInfo book = new BookInfo();
            book.setId(i);
            book.setBookName("书籍"+i);
            book.setAuthor("作者"+i);
            book.setCount(i*5+3);
            book.setPrice(new BigDecimal(new Random().nextInt(100)));
            book.setPublish("出版社"+i);
            book.setStatus(new Random().nextInt(2));
            bookList.add(book);
        }
        return bookList;
    }
}
